Page({
  data: {
    starCount: 0,
    forksCount: 0,
    visitTotal: 0,
    share: {
      title: '',
      desc: ''
    }
  },
  onLoad: function () {
    const db = wx.cloud.database();
    db.collection('t_home').doc(String('8108eb66-2ea9-48ac-8690-c76dc07a8b7d')).get().then(res => {
      let data = res.data;
      this.setData({
        share: {
          title: data.share_title,
          desc: data.share_desc
        }
      })
    });
  },
  /**
  * 用户点击右上角分享
  */
  onShareAppMessage: function () {
    return {
      title: this.data.share.title,
      desc: this.data.share.desc,
      path: 'pages/home/index'
    }
  }
})